﻿using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Windows;
using X.Infrastructure.WPF.Caliburn.Base;
using X.WPF.Controls.Sample.ViewModels;
using X.WPF.Controls.Sample.ViewModels.HomeContext;

namespace X.WPF.Controls.Sample
{
    public class Startup : StartupBase
    {

        #region # 构造器

        #region 无参构造器
        public Startup()
        {
        }
        #endregion

        #endregion

        #region # 方法 

        #region 选择程序集列表 —— override IEnumerable<Assembly> SelectAssemblies()
        /// <summary>
        /// 选择程序集列表
        /// </summary>
        /// <returns>程序集列表</returns>
        protected override IEnumerable<Assembly> SelectAssemblies()
        {
            List<Assembly> assemblies = base.SelectAssemblies().ToList();

            return assemblies;
        }
        #endregion

        #endregion

        #region # 事件

        #region 程序启动事件 —— override async void OnStartup(object sender, StartupEventArgs e)
        /// <summary>
        /// 程序启动事件
        /// </summary>
        protected override async void OnStartup(object sender, StartupEventArgs e)
        {
            base.OnStartup(sender, e);

            await this.DisplayRootViewForAsync(typeof(IndexViewModel));
        }
        #endregion

        #endregion

    }
}
